<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button type="button" id="btn">login</button>

		<script type="text/javascript">
			class Login {
				createLayout() {
					var lm = document.createElement('div');
					lm.innerHTML = '98';
					document.body.appendChild(lm);
					lm.style.display = 'none'
					return lm
				}
			}

			class Single {
				getSingle(fn) {
					var result;
					return function() {
						return result || (result = fn.apply())
					}

				}
			}

			var btm = document.getElementById("btn");
			var login = new Login();
			var single = new Single();

			var createLoginLayer = single.getSingle(login.createLayout)
			btm.onclick = function() {
				var layout = createLoginLayer()
				layout.style.display = 'block'
				console.log(12);
			}



			class Wp {
				constructor(arg, love) {
					this.arg = arg;
					this.love = love;
				}

			}

			class Love {
				create(name, love = "me") {
					return new Wp(name, love)
				}
			}

			var love = new Love()

			var duck = love.create('寸寸隽')
			console.log(duck);
		</script>
	</body>
</html>
